﻿@* Generator: Template *@
@functions {
    public dynamic Model { get; set; }
    public Serenity.CodeGenerator.GeneratorConfig Config { get; set; }
}@{
    var dotModule = Model.Module == null ? "" : ("." + Model.Module);
}
namespace @(Model.RootNamespace)@(dotModule) {

    @@Serenity.Decorators.registerClass()
    @@Serenity.Decorators.responsive()
@if (Config.MaximizableDialog)
{    <text>@@Serenity.Decorators.maximizable()</text>
}
    export class @(Model.ClassName)Dialog extends Serenity.EntityDialog<@(Model.RowClassName), any> {
        protected getFormKey() { return @(Model.ClassName)Form.formKey; }@if (Model.Identity != null)
        {<text>
        protected getIdProperty() { return @(Model.RowClassName).idProperty; }</text>}

        protected getLocalTextPrefix() { return @(Model.RowClassName).localTextPrefix; }@if (Model.NameField != null)
        {<text>
        protected getNameProperty() { return @(Model.RowClassName).nameProperty; }</text>}

        protected getService() { return @(Model.ClassName)Service.baseUrl; }

        protected form = new @(Model.ClassName)Form(this.idPrefix);

        @if (Config.MaximizableDialog)
        {        <text>dialogOpen() {
                    super.dialogOpen();
                   this.element.closest(".ui-dialog").find(".ui-icon-maximize-window").click();
                 }</text>
        }
    }
}